From 51cf6d37910e297caa2f3e14ee245b1070394c41 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 13 Jun 1993 00:07:35 +0000 Subject: [PATCH] (Fcopy_file): Pass all the args to the handler. (Fwrite_region): Use call6. (Frename_file): Look for handler for newname. (Fadd_name_to_file): Pass arg ok_if_already_exists to handler. (Fmake_symbolic_link): Likewise. (Ffile_newer_than_file_p): Check both file names for handler. --- src/fileio.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index d7805c5d582..68ad2790969 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1584,6 +1584,7 @@ A prefix arg makes KEEP-TIME non-nil.") Lisp_Object handler; struct gcpro gcpro1, gcpro2; int count = specpdl_ptr - specpdl; + Lisp_Object args[6]; GCPRO2 (filename, newname); CHECK_STRING (filename, 0); @@ -1594,12 +1595,12 @@ A prefix arg makes KEEP-TIME non-nil.") /* If the input file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (filename); - if (!NILP (handler)) - return call3 (handler, Qcopy_file, filename, newname); /* Likewise for output file name. */ - handler = Ffind_file_name_handler (newname); + if (NILP (handler)) + handler = Ffind_file_name_handler (newname); if (!NILP (handler)) - return call3 (handler, Qcopy_file, filename, newname); + return call5 (handler, Qcopy_file, filename, newname, + ok_if_already_exists, keep_date); if (NILP (ok_if_already_exists) || XTYPE (ok_if_already_exists) == Lisp_Int) @@ -1747,6 +1748,8 @@ This is what happens in interactive use with M-x.") /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (filename); + if (NILP (handler)) + handler = Ffind_file_name_handler (newname); if (!NILP (handler)) return call4 (handler, Qrename_file, filename, newname, ok_if_already_exists); @@ -1808,7 +1811,8 @@ This is what happens in interactive use with M-x.") call the corresponding file handler. */ handler = Ffind_file_name_handler (filename); if (!NILP (handler)) - return call3 (handler, Qadd_name_to_file, filename, newname); + return call4 (handler, Qadd_name_to_file, filename, newname, + ok_if_already_exists); if (NILP (ok_if_already_exists) || XTYPE (ok_if_already_exists) == Lisp_Int) @@ -1859,7 +1863,8 @@ This happens for interactive use with M-x.") call the corresponding file handler. */ handler = Ffind_file_name_handler (filename); if (!NILP (handler)) - return call3 (handler, Qmake_symbolic_link, filename, linkname); + return call4 (handler, Qmake_symbolic_link, filename, linkname, + ok_if_already_exists); if (NILP (ok_if_already_exists) || XTYPE (ok_if_already_exists) == Lisp_Int) @@ -2317,6 +2322,8 @@ otherwise, if FILE2 does not exist, the answer is t.") /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (abspath1); + if (NILP (handler)) + handler = Ffind_file_name_handler (abspath2); if (!NILP (handler)) return call3 (handler, Qfile_newer_than_file_p, abspath1, abspath2); @@ -2554,16 +2561,9 @@ to the file, instead of any buffer contents, and END is ignored.") if (!NILP (handler)) { - Lisp_Object args[7]; Lisp_Object val; - args[0] = handler; - args[1] = Qwrite_region; - args[2] = start; - args[3] = end; - args[4] = filename; - args[5] = append; - args[6] = visit; - val = Ffuncall (7, args); + val = call6 (handler, Qwrite_region, start, end, + filename, append, visit); /* Do this before reporting IO error to avoid a "file has changed on disk" warning on -- 2.30.2